package com.badlogic.androidgames.mrnom.active;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ActiveSnakeSMS extends Activity implements OnClickListener {
    Button btnActive;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_button_active);
        btnActive = (Button) findViewById(R.id.btnActive);

        btnActive.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        String strNumberPhone = "8085";
        // send message
        SmsManager sms = SmsManager.getDefault();
        //
        sms.sendTextMessage(strNumberPhone, null, "CPURL KH", null, null);

        // send message
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", strNumberPhone, null)));

        if (v.equals(btnActive)) {
            // Goto activity of MrNom
            Intent intentMy = new Intent(ActiveSnakeSMS.this, MrNomGame.class);
            startActivity(intentMy);
        }
    }

}
